package pta;/**
 * @author： li
 * @date： 2022-04-04 10:48
 * @version 1.0
 */
import java.io.*;
public class 稳赢 {
    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
    public static void main(String[] args) throws IOException {
        int k =Integer.parseInt(in.readLine());
        int count=0;
        String x;
        do {
            x =in.readLine();
            if(x.equals("End"))
                break;
                if(count==k){
                    out.write(x+"\n");
                count=0;
                }
                else {
             if(x.equals("ChuiZi"))
                 out.write("Bu\n");
             if(x.equals("JianDao"))
                 out.write("ChuiZi\n");
             if(x.equals("Bu"))
                 out.write("JianDao\n");
             count++;
                }
        }while(!(x.equals("End")));
        out.flush();
        in.close();
    }
}
